<template>
  <div v-loading="pageDataLoading">
    <el-row>
      <el-col :span="24">
        <BreakSpace label="缺省参数" :containerStyle="{ marginBottom: '10px' }"></BreakSpace>
        <div class="grid-content bg-purple">
          <FormPanel ref="formPanel" :list="formList" :cols="4" :labelWidth="110" :formType="type" :isSubmitBtn="false" @formChange="formChangeHandle" />
        </div>
      </el-col>
    </el-row>
    <el-row :gutter="10">
      <el-col :span="24">
        <BreakSpace label="营业时间" :containerStyle="{ marginBottom: '10px' }"></BreakSpace>
        <div class="grid-content bg-purple">
          <FormPanel ref="formPanel13" :list="formList13" :cols="2" :labelWidth="150" :formType="type" :isSubmitBtn="false" @formChange="formChangeHandle13" />
        </div>
      </el-col>
    </el-row>
    <!-- 预约相关 -->
    <div class="grid-content bg-purple-light">
      <BreakSpace label="预约" :containerStyle="{ marginBottom: '10px' }"></BreakSpace>
      <FormPanel ref="formPanel1" :list="formList1" :cols="3" :labelWidth="140" :formType="type" :isSubmitBtn="false" @formChange="formChangeHandle1" />
    </div>
    <!-- 开单相关 -->
    <div class="grid-content bg-purple">
      <BreakSpace label="开工单" :containerStyle="{ marginBottom: '10px' }"></BreakSpace>
      <el-row :gutter="20">
        <el-col :span="12" :offset="0">
          <FormPanel ref="formPanel2" :list="formList2" :labelWidth="140" :cols="4" :formType="type" :isSubmitBtn="false" @formChange="formChangeHandle2" />
        </el-col>
        <el-col :span="12" :offset="0">
          <FormPanel ref="formPanel6" :list="formList6" :cols="1" :labelWidth="140" :formType="type" :isSubmitBtn="false" @formChange="formChangeHandle6" />
        </el-col>
      </el-row>
      <div class="flexRow" v-if="this.appId == 'beijing'">
        <span class="maintain">油车保养规则</span>
        <FormPanel ref="formPanel7" :list="formList7" :cols="2" :labelWidth="140" :formType="type" :isSubmitBtn="false" @formChange="formChangeHandle7" />
      </div>
      <div class="flexRow">
        <span class="maintain">新能源保养规则</span>
        <FormPanel ref="formPanel8" :list="formList8" :cols="2" :labelWidth="140" :formType="type" :isSubmitBtn="false" @formChange="formChangeHandle8" />
      </div>
    </div>

    <!-- 结算 -->
    <div class="grid-content bg-purple">
      <BreakSpace label="结算" :containerStyle="{ marginBottom: '10px' }"></BreakSpace>
      <FormPanel ref="formPanel3" :list="formList3" :labelWidth="170" :formType="type" :isSubmitBtn="false" @formChange="formChangeHandle3" />
    </div>

    <!-- 首保规则 -->
    <div>
      <BreakSpace label="首保规则" :containerStyle="{ marginBottom: '10px' }"></BreakSpace>
      <div class="flexRow" v-if="this.appId == 'beijing'">
        <span class="maintain">油车首保规则</span>
        <FormPanel ref="formPanel9" :list="formList9" :formType="type" style="width:80%" :isSubmitBtn="false" @formChange="formChangeHandle9" />
      </div>
      <div class="flexRow">
        <span class="maintain">新能源首保规则</span>
        <FormPanel ref="formPanel14" :list="formList14" :formType="type" style="width:80%" :isSubmitBtn="false" @formChange="formChangeHandle14" />
      </div>
    </div>

    <el-row :gutter="10" v-show="false">
      <el-col :span="8">
        <el-col :span="24">
          <BreakSpace label="车间管理" :containerStyle="{ marginBottom: '10px' }"></BreakSpace>
          <div class="grid-content bg-purple">
            <FormPanel ref="formPanel4" :list="formList4" :cols="1" :labelWidth="250" :formType="type" :isSubmitBtn="false" @formChange="formChangeHandle4" />
          </div>
        </el-col>
      </el-col>
    </el-row>

    <el-row v-show="false">
      <el-col :span="24">
        <BreakSpace label="维修合同说明" :containerStyle="{ marginBottom: '10px' }"></BreakSpace>
        <div class="grid-content bg-purple">
          <FormPanel ref="formPanel11" :list="formList11" :cols="4" :labelWidth="110" :formType="type" :isSubmitBtn="false" @formChange="formChangeHandle11" />
        </div>
      </el-col>
    </el-row>

    <el-row :gutter="10">
      <el-col :span="24">
        <BreakSpace label="客户关怀" :containerStyle="{ marginBottom: '10px' }"></BreakSpace>
        <div class="grid-content bg-purple">
          <FormPanel ref="formPanel5" :list="formList5" :cols="3" :labelWidth="170" :formType="type" :isSubmitBtn="false" @formChange="formChangeHandle5" />
        </div>
      </el-col>
    </el-row>

    <!-- 索赔参数 -->
    <div>
      <BreakSpace label="索赔" :containerStyle="{ marginBottom: '10px' }"></BreakSpace>
      <div class="grid-content bg-purple">
        <FormPanel ref="formPanel12" :list="formList12" :labelWidth="170" :formType="type" :isSubmitBtn="false" @formChange="formChangeHandle12" />
      </div>
    </div>
    <!--
    <el-row :gutter="10">
      <el-col :span="24">
        <BreakSpace label="JD标识参数" :containerStyle="{ marginBottom: '10px' }"></BreakSpace>
        <div class="grid-content bg-purple">
          <FormPanel ref="formPanel10" :list="formList10" :cols="2" :labelWidth="180" :formType="type" :isSubmitBtn="false" @formChange="formChangeHandle10" />
        </div>
      </el-col>
    </el-row> -->
    <div></div>
    <div
      :style="{
        textAlign: 'center'
      }"
    >
      <el-button @click="closeDialog">取 消</el-button>
      <AjaxButton v-if="type !== 'show'" type="primary" :click="saveDialog">{{ btnText }}</AjaxButton>
    </div>
  </div>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
import moment from 'moment';
import dictCode from '@/utils/dictCode';
import { getAppId } from '@/assets/js/auth';
import { findInvoiceCode, queryType, findAllRepair, updateBasicParam, findStorageCode, getBrand, getSeries, getModel, findAllRepairType, getRepairType } from '@/api/repair/basicParameters';
// import { getPinpSelect, getChexSelect, getCheModelSelect } from '@/api/repair/repairReception/customer';
import { getPinpSelect, getChexSelect, getCheModelSelect } from '@/api/repair/repairReception/customer/brand.js';
import { searchRoleByCode } from '@/api/common/empSelect/index';
import { sleep } from '@/utils';
import _ from 'lodash';

export default {
  name: 'PartModal',
  mixins: [dictionary],
  props: {
    type: {
      type: String,
      default: 'add'
    },
    rowData: {
      type: Object,
      default: () => ({})
    }
  },

  data() {
    (this.aList = [
      { text: '客服专员', value: '1' },
      { text: '保险专员', value: '2' },
      { text: '上次接待顾问', value: '3' },
      { text: '专属服务顾问', value: '4' },
      { text: '定保专员', value: '5' }
    ]),
      (this.conf = { add: '保 存', edit: '修 改', show: '明细' });
    this.saveData = null;
    this.saveData1 = null;
    this.saveData2 = null;
    this.saveData3 = null;
    this.saveData4 = null;
    this.saveData5 = null;
    this.saveData7 = null;
    this.saveData8 = null;
    this.saveData9 = null;
    this.saveData10 = null;
    this.saveData11 = null;
    this.saveData12 = null;
    this.saveData13 = null;
    return {
      appId: getAppId(),
      formList: this.createFormList(),
      formList1: this.createFormList1(),
      formList2: this.createFormList2(),
      formList3: this.createFormList3(),
      formList4: this.createFormList4(),
      formList5: this.createFormList5(),
      formList6: this.createFormList6(),
      formList7: this.createFormList7(),
      formList8: this.createFormList8(),
      formList9: this.createFormList9(),
      formList10: this.createFormList10(),
      formList11: this.createFormList11(),
      formList12: this.createFormList12(),
      formList13: this.createFormList13(),
      formList14: this.createFormList14(),
      flag: false,
      flag1: false,
      flag2: false,
      flag3: false,
      flag4: false,
      flag5: false,
      flag6: false,
      flag7: false,
      flag8: false,
      flag9: false,
      flag10: false,
      flag11: false,
      flag12: false,
      flag13: false,
      pageDataLoading: false // 页面加载状态
    };
  },
  computed: {
    btnText() {
      return this.conf[this.type];
    }
  },
  created() {
    this.init();
    this.getBrand();
    this.findAllRepairType();
    this.queryType();
    // this.findInvoiceCode();
    // this.queryQuailtyInspector();
  },
  mounted() {
    this.queryDefaultPa();
  },
  methods: {
    init() {
      if (this.type !== 'add') {
        // 更新接口需要的记录 ID
        this.recordId = this.rowData.partNo;
        this.formList.forEach(x => {
          x.initialValue = this.rowData[x.fieldName];
        });
      }
    },
    createFormList() {
      return [
        {
          type: 'INPUT',
          label: '车牌号前缀',
          fieldName: '1002',
          placeholder: '请输入...',
          rules: [
            // { required: false, message: '请输入车牌号前缀', trigger: 'blur' }
            // {
            //   required: true,
            //   pattern: /^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[a-zA-Z](([DF]((?![IO])[a-zA-Z0-9](?![IO]))[0-9]{4})|([0-9]{5}[DF]))|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})$/,
            //   message: '请输入正确的车牌号'
            // }
            {
              required: true,
              pattern: /^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[a-zA-Z])$/,
              message: '请输入车牌号前缀(两位)'
            }
          ]
        },
        {
          type: 'SELECT',
          label: '缺省品牌',
          fieldName: '1004',
          placeholder: '请选择...',
          itemList: [],
          change: val => {
            this.changePinpSelect(val);
          },
          rules: [{ required: false, message: '请选择缺省品牌', trigger: 'change' }]
        },
        {
          type: 'SELECT',
          label: '缺省车系',
          fieldName: '1005',
          placeholder: '请选择...',
          itemList: [],
          change: val => {
            this.changeChexSelect(val);
          },
          rules: [{ required: false, message: '请选择缺省车系', trigger: 'change' }]
        },
        {
          type: 'SELECT',
          label: '缺省车型',
          fieldName: '1006',
          placeholder: '请选择...',
          itemList: [],
          rules: [{ required: false, message: '请选择缺省车型', trigger: 'change' }]
        },
        // {
        //   type: 'INPUT_NUMBER',
        //   label: '三包年限(年)',
        //   fieldName: '1903',
        //   placeholder: '请输入...',
        //   readonly: true,
        //   rules: [
        //     { required: false, message: '请输入三包年限(年)', trigger: 'blur' },
        //     { required: true, pattern: /^[1-9][0-9]{0,1}$/, message: '请输入正整数(最大两位)' }
        //   ]
        // },
        {
          type: 'INPUT',
          label: '电话区号',
          fieldName: '1010',
          placeholder: '请输入...',
          maxlength: 4,
          rules: [{ required: true, pattern: /^(0\d{2,3})$/, message: '请输入电话区号' }]
        },
        {
          type: 'SELECT',
          hidden: true,
          label: '缺省维修类型',
          fieldName: '1119',
          placeholder: '请选择...',
          itemList: [],
          rules: [{ required: false, message: '请选择缺省维修类型', trigger: 'change' }]
        },
        // {
        //   type: 'SELECT',
        //   label: '缺省工时单价根据',
        //   fieldName: '1011',
        //   placeholder: '请选择...',
        //   itemList: this.createDictList('8063'),
        //   rules: [{ required: false, message: '请选择缺省工时单价根据', trigger: 'change' }]
        // },
        // {
        //   type: 'SELECT',
        //   label: '派工类型',
        //   fieldName: '9505',
        //   initialValue: 'major',
        //   placeholder: '请选择...',
        //   itemList: [
        //     { value: 'group', text: '班组' },
        //     { value: 'major', text: '主修人' }
        //   ],
        //   rules: [{ required: false, message: '请选择缺省工时单价根据', trigger: 'change' }]
        // },
        // {
        //   type: 'INPUT_NUMBER',
        //   label: '三包里程(公里)',
        //   fieldName: '1904',
        //   placeholder: '请输入...',
        //   readonly: true,
        //   rules: [{ required: false, message: '请输入三包里程(公里)', trigger: 'blur' }]
        // },
        // {
        //   type: 'SELECT',
        //   label: '缺省仓库',
        //   fieldName: '1008',
        //   placeholder: '请选择',
        //   itemList: [],
        //   rules: [{ required: false, message: '请选择缺省仓库', trigger: 'change' }]
        // },
        // {
        //   type: 'SELECT',
        //   label: '缺省维修项目类型',
        //   fieldName: '1082',
        //   placeholder: '请选择...',
        //   itemList: [],
        //   rules: [{ required: false, message: '请选择缺省维修项目类型', trigger: 'change' }]
        // },
        {
          type: 'INPUT_NUMBER',
          label: '标准日均行驶里程',
          fieldName: '9104',
          placeholder: '请输入...',
          rules: [{ required: false, message: '请输入标准日均行驶里程', trigger: 'blur' }]
        }
        // {
        //   type: 'CHECKBOX',
        //   labelOptions: {
        //     type: 'CHECKBOX',
        //     fieldName: '9105',
        //     options: {
        //       trueValue: 10041001,
        //       falseValue: 10041002
        //     }
        //   },
        //   fieldName: '9105',
        //   render: () => {
        //     return <span>打印建议修理项目</span>;
        //   }
        // },
        // {
        //   type: 'CHECKBOX',
        //   label: '是否开通机电车间',
        //   fieldName: '7001',
        //   change: val => {
        //     this.electromechanicalChange(val);
        //   }
        // },
        // {
        //   type: 'CHECKBOX',
        //   label: '机电车间维修类型',
        //   disabled: true,
        //   fieldName: '7101',
        //   change: val => {
        //     this.electromeChange(val);
        //   }
        // },
        // {
        //   type: 'MULTIPLE_SELECT',
        //   label: '机电委托书类型',
        //   fieldName: '7201',
        //   disabled: true,
        //   placeholder: '请选择...',
        //   itemList: [],
        //   change: val => {
        //     this.MaintenanceOptions(val);
        //   }
        // },
        // {
        //   type: 'CHECKBOX',
        //   label: '是否开通钣喷车间',
        //   fieldName: '7002',
        //   change: val => {
        //     this.throughChange(val);
        //   }
        // },
        // {
        //   type: 'CHECKBOX',
        //   label: '钣喷车间维修类型',
        //   disabled: true,
        //   fieldName: '7102',
        //   change: val => {
        //     this.throughRepairChange(val);
        //   }
        // },
        // {
        //   type: 'MULTIPLE_SELECT',
        //   label: '钣喷委托书类型',
        //   fieldName: '7202',
        //   disabled: true,
        //   placeholder: '请选择...',
        //   itemList: [],
        //   change: val => {
        //     this.Maintenance(val);
        //   }
        // },
        // {
        //   type: 'SELECT',
        //   label: '默认检验员',
        //   fieldName: '1012',
        //   itemList: []
        // },
        // {
        //   type: 'INPUT_NUMBER',
        //   label: '自建维修项目限制系数',
        //   labelWidth: '130px',
        //   fieldName: '9501',
        //   disabled: true
        // },
        // {
        //   type: 'CHECKBOX',
        //   label: '厂家套餐是否打印子项',
        //   labelWidth: '134px',
        //   fieldName: '9502'
        // },
        // {
        //   type: 'CHECKBOX',
        //   label: '自建套餐是否打印子项',
        //   labelWidth: '134px',
        //   fieldName: '9503'
        // }
        // ,
        // {
        //   type: 'SELECT',
        //   label: '收费类别',
        //   fieldName: '1060',
        //   placeholder: '请选择',
        //   itemList: this.createDictList('1004'),
        //   rules: [{ required: false, message: '请选择收费类别', trigger: 'change' }]
        // }
      ];
    },
    createFormList1() {
      return [
        {
          type: 'INPUT_NUMBER',
          label: '提前进厂时间',
          fieldName: '1047',
          placeholder: '请输入...',
          style: { width: 'calc(60% - 40px)' },
          descOptions: {
            content: '分钟前'
          },
          // unitRender: () => {
          //   return <div>分钟前</div>;
          // },
          rules: [
            { required: false, message: '请输入提前进厂时间', trigger: 'blur' },
            { required: true, pattern: /^([1-9]\d{0,3}|9999)$/, message: '请输入正整数(最大四位)' }
          ]
        },
        {
          type: 'INPUT_NUMBER',
          label: '延迟进厂',
          fieldName: '1048',
          placeholder: '请输入...',
          style: { width: 'calc(60% - 40px)' },
          descOptions: {
            content: '分钟前'
          },
          rules: [
            { required: false, message: '请输入延迟进厂', trigger: 'blur' },
            { required: true, pattern: /^([1-9]\d{0,3}|9999)$/, message: '请输入正整数(最大四位)' }
          ]
        },
        {
          type: 'INPUT_NUMBER',
          label: '首保提醒后',
          fieldName: '1094',
          placeholder: '请输入...',
          style: { width: 'calc(60% - 40px)' },
          descOptions: {
            content: '天内回厂为提醒回厂'
          }
        },
        {
          type: 'INPUT_NUMBER',
          label: '定保提醒后',
          fieldName: '1095',
          placeholder: '请输入...',
          style: { width: 'calc(60% - 40px)' },
          descOptions: {
            content: '天内回厂为提醒回厂'
          }
        },
        {
          type: 'INPUT_NUMBER',
          label: '保险到期提醒后',
          fieldName: '1097',
          placeholder: '请输入...',
          style: { width: 'calc(60% - 40px)' },
          descOptions: {
            content: '天内回厂为提醒回厂'
          }
        }
        // {
        //   type: 'INPUT_NUMBER',
        //   label: '预约维修时间间隔',
        //   fieldName: '9052',
        //   placeholder: '请输入...',
        //   style: { width: 'calc(60% - 40px)' },
        //   descOptions: {
        //     content: '分钟'
        //   },
        //   rules: [
        //     { required: false, message: '请输入预约维修时间间隔', trigger: 'blur' },
        //     { required: true, pattern: /^([1-9]\d{0,2}|999)$/, message: '请输入正整数(最大三位)' }
        //   ]
        // },
        // {
        //   type: 'INPUT_NUMBER',
        //   label: '预约交车时间',
        //   fieldName: '9053',
        //   placeholder: '请输入...',
        //   style: { width: 'calc(60% - 40px)' },
        //   descOptions: {
        //     content: '分钟'
        //   },
        //   rules: [
        //     { required: false, message: '请输入预约交车时间', trigger: 'blur' },
        //     { required: true, pattern: /^([1-9]\d{0,2}|999)$/, message: '请输入正整数(最大三位)' }
        //   ]
        // }
      ];
    },
    createFormList2() {
      return [
        {
          type: 'CHECKBOX',
          label: '是否带走旧件',
          fieldName: '8019'
        },
        {
          type: 'CHECKBOX',
          label: '是否洗车',
          fieldName: '1067'
        },
        {
          type: 'CHECKBOX',
          label: '是否充电',
          fieldName: '1070'
        },
        // {
        //   type: 'CHECKBOX',
        //   label: '是否路试',
        //   fieldName: '1068'
        // },
        // {
        //   type: 'CHECKBOX',
        //   label: '是否质检',
        //   fieldName: '1069'
        // },
        // {
        //   type: 'CHECKBOX',
        //   label: '是否显示派工工时',
        //   fieldName: '1050'
        // },
        {
          type: 'CHECKBOX',
          label: '是否有贵重物品',
          fieldName: '1071'
        }
        // {
        //   type: 'CHECKBOX',
        //   label: '维修索赔是否别开工单',
        //   fieldName: '8020'
        // },
        // {
        //   type: 'CHECKBOX',
        //   label: 'FD未处理不允许完工',
        //   fieldName: '9401'
        // },
        // {
        //   type: 'CHECKBOX',
        //   label: 'FD单上传及时率控制',
        //   fieldName: '9403'
        // },
        // {
        //   type: 'CHECKBOX',
        //   label: '委托书电话掩码显示',
        //   fieldName: '9404'
        // }
      ];
    },
    createFormList3() {
      return [
        {
          type: 'SELECT',
          label: '结算精度',
          fieldName: '8011',
          placeholder: '请选择...',
          itemList: this.createDictList('8065'),
          rules: [{ required: false, message: '请选择结算精度', trigger: 'change' }]
        },
        {
          type: 'SELECT',
          label: '结算圆整方式',
          fieldName: '1009',
          placeholder: '请选择...',
          itemList: this.createDictList('8064'),
          rules: [{ required: false, message: '请选择结算圆整方式', trigger: 'change' }]
        },
        {
          type: 'SELECT',
          label: '缺省发票类型',
          fieldName: '1030',
          placeholder: '请选择...',
          itemList: this.createDictList(1100),
          rules: [{ required: true, message: '请选择缺省发票类型', trigger: 'change' }]
        },
        {
          type: 'SELECT',
          label: '缺省付款方式',
          fieldName: '1121',
          placeholder: '请选择...',
          itemList: this.createDictList('8044', [80441010]),
          rules: [{ required: true, message: '请选择缺省付款方式', trigger: 'change' }]
        },
        // {
        //   type: 'SELECT',
        //   label: '工单应收金额为0不自动结清',
        //   fieldName: '1096',
        //   placeholder: '请选择...',
        //   itemList: this.createDictList('1004'),
        //   rules: [{ required: false, message: '请选择工单应收金额为0不自动结清', trigger: 'change' }]
        // },
        // {
        //   type: 'SELECT',
        //   label: '提交结算时工单拆分',
        //   fieldName: '1098',
        //   placeholder: '请选择...',
        //   itemList: this.createDictList('1004'),
        //   rules: [{ required: false, message: '请选择提交结算时工单拆分', trigger: 'change' }]
        // },
        {
          type: 'INPUT_NUMBER',
          label: '维修税率',
          fieldName: '1003',
          initialValue: 0.13,
          max: 1,
          min: 0,
          percision: 2,
          placeholder: '请输入...',
          rules: [
            { required: true, message: '请输入维修税率', trigger: 'change' },
            { pattern: /^([0-1]{0,1})(\.\d{1,2})?$/, message: '最多保留两位小数', trigger: 'blur' }
          ]
        },
        {
          type: 'INPUT_NUMBER',
          label: '结算去零限额',
          fieldName: '1029',
          initialValue: 0,
          min: 0,
          percision: 2
        }
        // {
        //   type: 'SELECT',
        //   label: '是否启用收款',
        //   fieldName: '9402',
        //   placeholder: '请选择...',
        //   itemList: this.createDictList('1004'),
        //   rules: [{ required: false, message: '请选择是否启用收款', trigger: 'change' }]
        // },
        // {
        //   type: 'SELECT',
        //   label: '打印机动车竣工出厂合格证',
        //   fieldName: '9405',
        //   placeholder: '请选择...',
        //   itemList: this.createDictList('1004')
        // }
        // {
        //   type: 'SELECT',
        //   label: '财务接口参数',
        //   fieldName: '9406',
        //   placeholder: '请选择...',
        //   itemList: this.createDictList('9645')
        // }
      ];
    },
    createFormList4() {
      return [
        {
          type: 'CHECKBOX',
          label: '车间派工显示收费工时/工时费',
          fieldName: '1025'
        },
        {
          type: 'CHECKBOX',
          label: '车间派工显示配件单价/配件费',
          fieldName: '1051'
        }
      ];
    },
    createFormList5() {
      return [
        {
          type: 'INPUT_NUMBER',
          label: '首保到期提前',
          fieldName: '6002',
          placeholder: '请输入...',
          style: { width: '150px' },
          descOptions: {
            content: '天提醒'
          },
          rules: [
            { required: false, message: '请输入定期保养时间间隔', trigger: 'blur' },
            { required: true, pattern: /^([1-9]\d{0,2}|999)$/, message: '请输入正整数(最大三位)' }
          ]
        },
        {
          type: 'INPUT_NUMBER',
          label: '定保到期提前',
          fieldName: '6001',
          placeholder: '请输入...',
          style: { width: '150px' },
          descOptions: {
            content: '天提醒'
          },
          rules: [
            { required: false, message: '请输入定期保养时间间隔', trigger: 'blur' },
            { required: true, pattern: /^([1-9]\d{0,2}|999)$/, message: '请输入正整数(最大三位)' }
          ]
        },
        {
          type: 'INPUT_NUMBER',
          label: '保险到期提前',
          fieldName: '6003',
          placeholder: '请输入...',
          style: { width: '150px' },
          descOptions: {
            content: '天提醒'
          },
          rules: [
            { required: false, message: '请输入保险保养时间间隔', trigger: 'blur' },
            { required: true, pattern: /^([1-9]\d{0,2}|999)$/, message: '请输入正整数(最大三位)' }
          ]
        },
        {
          type: 'INPUT_NUMBER',
          label: '',
          fieldName: '1062',
          placeholder: '请输入...',
          style: { width: '150px' },
          descOptions: {
            content: '天未进厂,自动标记为非激活客户'
          },
          rules: [
            { required: false, message: '请输入...', trigger: 'blur' },
            { required: true, pattern: /^([1-9]\d{0,2}|999)$/, message: '请输入正整数(最大三位)' }
          ]
        },
        {
          type: 'INPUT_NUMBER',
          label: '电池超长维修',
          fieldName: '6005',
          placeholder: '请输入...',
          style: { width: '150px' },
          descOptions: {
            content: '天提醒'
          },
          rules: [
            { required: false, message: '请输入定期保养时间间隔', trigger: 'blur' },
            { required: true, pattern: /^([1-9]\d{0,2}|999)$/, message: '请输入正整数(最大三位)' }
          ]
        },
        {
          type: 'INPUT_NUMBER',
          label: '生日前',
          fieldName: '6004',
          placeholder: '请输入...',
          style: { width: '150px' },
          descOptions: {
            content: '天提醒'
          },
          rules: [
            { required: false, message: '请输入生日前提醒间隔', trigger: 'blur' },
            { required: true, pattern: /^([1-9]\d{0,2}|999)$/, message: '请输入正整数(最大三位)' }
          ]
        }
      ];
    },
    createFormList6() {
      return [
        // {
        //   type: 'INPUT_NUMBER',
        //   label: '预交车预留',
        //   fieldName: '1063',
        //   placeholder: '请输入...',
        //   style: { width: 'calc(60% - 20px)' },
        //   descOptions: {
        //     content: '分钟'
        //   },
        //   // unitRender: () => {
        //   //   return <div>分钟</div>;
        //   // },
        //   rules: [
        //     { required: false, message: '请输入预交车预留', trigger: 'blur' },
        //     { required: true, pattern: /^([1-9]\d{0,2}|999)$/, message: '请输入正整数(最大三位)' }
        //   ]
        // },
        // {
        //   type: 'DATE',
        //   label: '三包执行日期',
        //   fieldName: '8201',
        //   style: { width: '200px' },
        //   placeholder: '请选择...',
        //   rules: [{ required: true, message: '请选择三包执行日期', trigger: 'blur' }]
        // },
        // {
        //   type: 'INPUT_NUMBER',
        //   label: '三包有效期',
        //   fieldName: '8202',
        //   placeholder: '请选择...',
        //   style: { width: 'calc(60% - 20px)' },
        //   descOptions: {
        //     content: '月'
        //   },
        //   rules: [{ required: true, message: '请输入三包有效期', trigger: 'blur' }]
        // },
        // {
        //   type: 'INPUT_NUMBER',
        //   label: '三包有效里程',
        //   fieldName: '8203',
        //   placeholder: '请选择...',
        //   style: { width: 'calc(60% - 20px)' },
        //   descOptions: {
        //     content: '公里'
        //   },
        //   rules: [{ required: true, message: '请输入三包有效里程', trigger: 'blur' }]
        // },
        // {
        //   type: 'RADIO',
        //   label: '缺省保养默认规则',
        //   fieldName: '8030',
        //   placeholder: '请选择...',
        //   itemList: [
        //     { text: '保养规则一', value: '1' },
        //     { text: '保养规则二', value: '2' }
        //   ]
        // }
      ];
    },
    createFormList7() {
      return [
        {
          type: 'INPUT_NUMBER',
          label: '定期保养时间间隔',
          fieldName: '1038',
          placeholder: '请输入...',
          style: { width: 'calc(60% - 40px)' },
          descOptions: {
            content: '天'
          },
          // unitRender: () => {
          //   return <div>天</div>;
          // },
          rules: [
            { required: false, message: '请输入定期保养时间间隔', trigger: 'blur' },
            { required: true, pattern: /^([1-9]\d{0,2}|999)$/, message: '请输入正整数(最大三位)' }
          ]
        },
        {
          type: 'INPUT_NUMBER',
          label: '定期保养里程间隔',
          fieldName: '1072',
          placeholder: '请输入...',
          style: { width: 'calc(60% - 40px)' },
          descOptions: {
            content: '公里'
          },
          rules: [{ required: false, message: '请输入定期保养里程间隔', trigger: 'blur' }]
        }
      ];
    },
    createFormList8() {
      return [
        {
          type: 'INPUT_NUMBER',
          label: '定期保养时间间隔',
          fieldName: '8017',
          placeholder: '请输入...',
          style: { width: 'calc(60% - 40px)' },
          descOptions: {
            content: '天'
          },
          rules: [
            { required: false, message: '请输入定期保养时间间隔', trigger: 'blur' },
            { required: true, pattern: /^([1-9]\d{0,2}|999)$/, message: '请输入正整数(最大三位)' }
          ]
        },
        {
          type: 'INPUT_NUMBER',
          label: '定期保养里程间隔',
          fieldName: '8018',
          placeholder: '请输入...',
          style: { width: 'calc(60% - 40px)' },
          descOptions: {
            content: '公里'
          },
          rules: [{ required: false, message: '请输入定期保养里程间隔', trigger: 'blur' }]
        }
      ];
    },
    createFormList9() {
      return [
        {
          type: 'INPUT_NUMBER',
          label: '销售天数',
          fieldName: '8012',
          placeholder: '请输入...',
          style: { width: '120px' },
          descOptions: {
            content: '天'
          },
          rules: [{ required: false, message: '请输入首保保养里程间隔', trigger: 'blur' }]
        },
        {
          type: 'INPUT_NUMBER',
          label: '行驶里程',
          fieldName: '8013',
          placeholder: '请输入...',
          style: { width: '120px' },
          descOptions: {
            content: '公里'
          },
          rules: [{ required: false, message: '请输入首保保养里程间隔', trigger: 'blur' }]
        }
      ];
    },
    createFormList10() {
      return [
        {
          type: 'INPUT',
          label: 'JD车辆最小计算月',
          fieldName: '8090',
          placeholder: '请输入...',
          disabled: true,
          rules: [
            { required: false, message: '请输入定期保养里程间隔', trigger: 'blur' },
            { required: true, pattern: /^([1-9]\d{0,2}|999)$/, message: '请输入正整数(最大三位)' }
          ]
        },
        {
          type: 'INPUT',
          label: 'JD车辆最大计算月',
          fieldName: '8091',
          placeholder: '请输入...',
          disabled: true,
          rules: [
            { required: false, message: '请输入定期保养里程间隔', trigger: 'blur' },
            { required: true, pattern: /^([1-9]\d{0,2}|999)$/, message: '请输入正整数(最大三位)' }
          ]
        },
        {
          type: 'DATE',
          label: 'JD车辆统计起始年月',
          fieldName: '8092',
          placeholder: '请输入...',
          disabled: true,
          rules: [{ required: false, message: '请输入定期保养里程间隔', trigger: 'blur' }]
        },
        {
          type: 'DATE',
          label: 'JD车辆统计截止年月',
          fieldName: '8093',
          placeholder: '请输入...',
          disabled: true,
          rules: [{ required: false, message: '请输入定期保养里程间隔', trigger: 'blur' }]
        }
      ];
    },
    createFormList11() {
      return [
        {
          type: 'INPUT',
          label: '委托书说明1',
          fieldName: '8101',
          placeholder: '请输入...',
          rules: [
            //  { required: false, message: '请输入委托书说明1', trigger: 'blur' },
            { pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }
          ]
        },
        {
          type: 'INPUT',
          label: '委托书说明2',
          fieldName: '8102',
          placeholder: '请输入...',
          rules: [{ pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '委托书说明3',
          fieldName: '8103',
          placeholder: '请输入...',
          rules: [{ pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '委托书说明4',
          fieldName: '8104',
          placeholder: '请输入...',
          rules: [{ pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '委托书说明5',
          fieldName: '8105',
          placeholder: '请输入...',
          rules: [{ pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '委托书说明6',
          fieldName: '8106',
          placeholder: '请输入...',
          rules: [{ pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '结算单说明1',
          fieldName: '8107',
          placeholder: '请输入...',
          rules: [{ pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '结算单说明2',
          fieldName: '8108',
          placeholder: '请输入...',
          rules: [{ pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '结算单说明3',
          fieldName: '8109',
          placeholder: '请输入...',
          rules: [{ pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '结算单说明4',
          fieldName: '8110',
          placeholder: '请输入...',
          rules: [{ pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '结算单说明5',
          fieldName: '8111',
          placeholder: '请输入...',
          rules: [{ pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '结算单说明6',
          fieldName: '8112',
          placeholder: '请输入...',
          rules: [{ pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '估算单说明1',
          fieldName: '8113',
          placeholder: '请输入...',
          rules: [{ pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '估算单说明2',
          fieldName: '8114',
          placeholder: '请输入...',
          rules: [{ pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '估算单说明3',
          fieldName: '8115',
          placeholder: '请输入...',
          rules: [{ pattern: /^.{0,500}$/, message: '最多添加500字', trigger: 'blur' }]
        }
      ];
    },
    createFormList12() {
      return [
        {
          type: 'INPUT_NUMBER',
          label: '发票开票最大金额',
          fieldName: '2001',
          placeholder: '请输入...'
        },
        {
          type: 'INPUT_NUMBER',
          label: '发票税率',
          fieldName: '2002',
          placeholder: '请输入...'
        }
      ];
    },
    createFormList13() {
      return [
        {
          type: 'TIME_SELECT',
          label: '营业上班时间',
          fieldName: '9301',
          placeholder: '请输入...',
          initialValue: '09:00',
          rules: [{ required: true, message: '请输入营业上班时间', trigger: 'blur' }]
        },
        {
          type: 'TIME_SELECT',
          label: '营业下班时间',
          fieldName: '9302',
          placeholder: '请输入...',
          initialValue: '21:00',
          rules: [{ required: true, message: '请输入营业下班时间', trigger: 'blur' }]
        }
      ];
    },
    createFormList14() {
      return [
        {
          type: 'INPUT_NUMBER',
          label: '销售天数',
          fieldName: '8251',
          placeholder: '请输入...',
          style: { width: '100px' },
          descOptions: {
            content: '天'
          },
          rules: [{ required: false, message: '请输入首保保养里程间隔', trigger: 'blur' }]
        },
        {
          type: 'INPUT_NUMBER',
          label: '行驶里程',
          fieldName: '8252',
          placeholder: '请输入...',
          style: { width: '100px' },
          descOptions: {
            content: '公里'
          },
          rules: [{ required: false, message: '请输入首保保养里程间隔', trigger: 'blur' }]
        }
      ];
    },
    changePinpSelect(id) {
      this.brandCode = id;
      if (!id) return;
      this.getChexSelect(id);
    },
    changeChexSelect(id) {
      if (!id) return;
      this.getCheModelSelect(this.brandCode, id);
    },
    async getBrand() {
      const res = await getPinpSelect();
      this.formList.find(x => x.fieldName === '1004').itemList = res.data.map(x => ({ text: x.brandName, value: x.brandId + '' }));
    },
    async getChexSelect(id) {
      const res = await getChexSelect(id);
      this.formList.find(x => x.fieldName === '1005').itemList = res.data.map(x => ({ value: x.seriesId + '', text: x.seriesName }));
    },
    async getCheModelSelect(brandId, seriesId) {
      const res = await getCheModelSelect(brandId, seriesId);
      this.formList.find(x => x.fieldName === '1006').itemList = res.data.map(x => ({ value: x.modelId + '', text: x.modelName }));
    },
    async findAllRepairType() {
      // const res = await findAllRepairType();
      // this.formList.find(x => x.fieldName === '1119').itemList = this.formList.find(x => x.fieldName === '1082').itemList = res.data.map(x => ({
      //   text: x.REPAIR_TYPE_NAME,
      //   value: x.REPAIR_TYPE_CODE
      // }));
    },
    async queryType() {
      const res = await queryType();
      // this.formList[10].itemList = res.data.map(x => ({ text: x.REPAIR_TYPE_NAME, value: x.REPAIR_TYPE_CODE }));
    },
    async findInvoiceCode() {
      const res = await findInvoiceCode();
      this.formList3.find(x => x.fieldName === '1030').itemList = res.data.map(x => ({ text: x.INVOICE_TYPE_NAME, value: x.INVOICE_TYPE_CODE }));
    },

    formChangeHandle(val) {
      this.flag = true;
      this.saveData = val;
    },
    formChangeHandle1(val) {
      this.flag1 = true;
      this.saveData1 = val;
    },
    formChangeHandle2(val) {
      this.flag2 = true;
      this.saveData2 = val;
    },
    formChangeHandle3(val) {
      this.flag3 = true;
      this.saveData3 = val;
    },
    formChangeHandle4(val) {
      this.flag4 = true;
      this.saveData4 = val;
    },
    formChangeHandle5(val) {
      this.flag5 = true;
      this.saveData5 = val;
    },
    formChangeHandle6(val) {
      this.flag6 = true;
      this.saveData6 = val;
    },
    formChangeHandle7(val) {
      this.flag7 = true;
      this.saveData7 = val;
    },
    formChangeHandle8(val) {
      this.flag8 = true;
      this.saveData8 = val;
    },
    formChangeHandle9(val) {
      this.flag8 = true;
      this.saveData9 = val;
    },
    formChangeHandle10(val) {
      this.flag10 = true;
      this.saveData10 = val;
    },
    formChangeHandle11(val) {
      this.flag11 = true;
      this.saveData11 = val;
    },
    formChangeHandle12(val) {
      this.flag12 = true;
      this.saveData12 = val;
    },
    formChangeHandle13(val) {
      this.flag13 = true;
      this.saveData13 = val;
    },
    formChangeHandle14(val) {
      this.flag14 = true;
      this.saveData14 = val;
    },

    async saveDialog() {
      let formData = await this.$refs.formPanel.GET_FORM_DATA();
      let formData1 = await this.$refs.formPanel1.GET_FORM_DATA();
      let formData2 = await this.$refs.formPanel2.GET_FORM_DATA();
      let formData3 = await this.$refs.formPanel3.GET_FORM_DATA();
      let formData4 = await this.$refs.formPanel4.GET_FORM_DATA();
      let formData5 = await this.$refs.formPanel5.GET_FORM_DATA();
      let formData6 = await this.$refs.formPanel6.GET_FORM_DATA();
      let formData7 = {};
      let formData9 = {};
      if (this.appId == 'beijing') {
        formData7 = await this.$refs.formPanel7.GET_FORM_DATA();
        formData9 = await this.$refs.formPanel9.GET_FORM_DATA();
      }
      let formData8 = await this.$refs.formPanel8.GET_FORM_DATA();
      let formData11 = await this.$refs.formPanel11.GET_FORM_DATA();
      let formData12 = await this.$refs.formPanel12.GET_FORM_DATA();
      let formData13 = await this.$refs.formPanel13.GET_FORM_DATA();
      let formData14 = await this.$refs.formPanel14.GET_FORM_DATA();
      let obj = Object.assign(
        {},
        formData[1],
        formData1[1],
        formData2[1],
        formData3[1],
        formData4[1],
        formData5[1],
        formData6[1],
        formData7[1],
        formData8[1],
        formData9[1],
        formData11[1],
        formData12[1],
        formData13[1],
        formData14[1]
      );
      // 去除10和12 hxj 2020-11-12
      if (
        !formData[0] &&
        !formData1[0] &&
        !formData2[0] &&
        !formData3[0] &&
        !formData4[0] &&
        !formData5[0] &&
        !formData6[0] &&
        !formData7[0] &&
        !formData8[0] &&
        !formData9[0] &&
        !formData11[0] &&
        !formData12[0] &&
        !formData13[0] &&
        !formData14[0]
      ) {
        if (obj[9302] < obj[9301]) {
          this.$message({
            type: 'warning',
            message: '营业上班时间，不能小于营业下班时间，请修改'
          });
          return false;
        }

        let res = await updateBasicParam(obj);
        if (res.resultCode === 200) {
          this.test();
          this.closeDialog();
        }
      } else {
        this.$message({
          type: 'warning',
          message: '请填写必填项!'
        });
      }
    },
    // 查询系统参数
    async queryDefaultPa() {
      this.pageDataLoading = true;
      try {
        let res = await findAllRepair();
        // 查询下拉参数
        const brand = Number(res.data['1004']);
        const series = Number(res.data['1005']);
        this.changePinpSelect(brand);
        this.changeChexSelect(series);
        // try {
        //   await this.repairTypePulldown(); // 获取维修类型下拉
        // } catch (err) {
        //   console.log(err, '获取维修类型失败');
        // }

        // 赋值所有参数
        let formItemLists = [];
        let intParams = ['1096', '1011', '1098', '9402', '9405', '8011', '1009', '1121', '9406', '1030']; // 值数字类型的参数(如字典项,需要手动转换)
        let arrParams = ['7201', '7202']; // 值为数组类型的参数
        for (let i = 0; i < 15; i++) {
          formItemLists = formItemLists.concat(this[`formList${i || ''}`]);
        }
        formItemLists.forEach(x => {
          x.initialValue = _.isNil(res.data[x.fieldName]) ? (arrParams.includes(x.fieldName) ? [] : '') : intParams.includes(x.fieldName) ? +res.data[x.fieldName] : res.data[x.fieldName];
        });

        // 钣喷、机电委托书参数单独处理(保证参数都在下拉列表中, 禁用状态)
        // this.formList.find(x => x.fieldName === '7201').initialValue = res.data['7201']
        //   ? res.data['7201'].filter(x => this.formList.find(x => x.fieldName === '7201').itemList.find(x2 => x2.value == x))
        //   : [];
        // this.formList.find(x => x.fieldName === '7202').initialValue = res.data['7202']
        //   ? res.data['7202'].filter(x => this.formList.find(x => x.fieldName === '7202').itemList.find(x2 => x2.value == x))
        //   : [];

        // this.formList.find(x => x.fieldName === '7101').disabled = res.data['7001'] == 0;
        // this.formList.find(x => x.fieldName === '7102').disabled = res.data['7002'] == 0;
        // this.formList.find(x => x.fieldName === '7201').disabled = res.data['7101'] == 0;
        // this.formList.find(x => x.fieldName === '7202').disabled = res.data['7102'] == 0;

        // this.MaintenanceOptions(res.data['7201'] || []);
        // this.Maintenance(res.data['7202'] || []);
      } catch (err) {
        console.log(err, '获取服务参数失败');
      } finally {
        this.pageDataLoading = false;
      }
    },

    closeDialog(param) {
      this.$refs.formPanel.RESET_FORM();
      this.$refs.formPanel1.RESET_FORM();
      this.$refs.formPanel2.RESET_FORM();
      this.$refs.formPanel3.RESET_FORM();
      this.$refs.formPanel4.RESET_FORM();
      this.$refs.formPanel5.RESET_FORM();
      this.$refs.formPanel6.RESET_FORM();

      this.$refs.formPanel8.RESET_FORM();
      if (this.appId == 'beijing') {
        this.$refs.formPanel7.RESET_FORM();
        this.$refs.formPanel9.RESET_FORM();
      }
      // this.$refs.formPanel10.RESET_FORM();
      this.$refs.formPanel11.RESET_FORM();
      // this.$refs.formPanel11.RESET_FORM();
      this.$refs.formPanel12.RESET_FORM();
      this.queryDefaultPa();
    },
    test() {
      this.$notify({
        title: '成功',
        message: '成功',
        type: 'success'
      });
    },
    electromechanicalChange(val) {
      if (val == 0) {
        this.formList.find(x => x.fieldName === '7101').disabled = true;
        this.formList.find(x => x.fieldName === '7101').initialValue = '0';
        this.formList.find(x => x.fieldName === '7201').disabled = true;
        this.formList.find(x => x.fieldName === '7201').initialValue = null;
      } else if (val == 1) {
        this.formList.find(x => x.fieldName === '7101').disabled = false;
      }
    },
    electromeChange(val) {
      if (val == 0) {
        this.formList.find(x => x.fieldName === '7201').disabled = true;
        this.formList.find(x => x.fieldName === '7201').initialValue = '';
      } else if (val == 1) {
        this.formList.find(x => x.fieldName === '7201').disabled = false;
      }
    },
    throughChange(val) {
      if (val == 0) {
        this.formList.find(x => x.fieldName === '7102').disabled = true;
        this.formList.find(x => x.fieldName === '7102').initialValue = '0';
        this.formList.find(x => x.fieldName === '7202').disabled = true;
        this.formList.find(x => x.fieldName === '7202').initialValue = null;
      } else if (val == 1) {
        this.formList.find(x => x.fieldName === '7102').disabled = false;
      }
    },
    throughRepairChange(val) {
      if (val == 0) {
        this.formList.find(x => x.fieldName === '7202').disabled = true;
        this.formList.find(x => x.fieldName === '7202').initialValue = null;
      } else if (val == 1) {
        this.formList.find(x => x.fieldName === '7202').disabled = false;
      }
    },
    // 维修类型下拉数据
    async repairTypePulldown() {
      let res = (await getRepairType()).data;
      this.formList.find(x => x.fieldName === '7201').itemList = res.map(x => ({ value: x.repairTtypeCode, text: x.repairTypeNme }));
      this.formList.find(x => x.fieldName === '7202').itemList = res.map(x => ({ value: x.repairTtypeCode, text: x.repairTypeNme }));
    },
    // 维修类型选择显示
    async MaintenanceOptions(val) {
      let arr = (await getRepairType()).data;
      let arr2 = val; // let k of arr2
      for (let i = 0; i < arr2.length; i++) {
        // console.log('wjf1', arr2[i]);
        arr = arr.filter(item => item.repairTtypeCode !== arr2[i]);
      }
      this.formList.find(x => x.fieldName === '7202').itemList = arr.map(x => ({ value: x.repairTtypeCode, text: x.repairTypeNme }));
    },
    // 维修类型选择显示
    async Maintenance(val) {
      let arr = (await getRepairType()).data;
      let arr2 = val; // let k of arr2
      for (let i = 0; i < arr2.length; i++) {
        console.log('wjf1', arr2[i]);
        arr = arr.filter(item => item.repairTtypeCode !== arr2[i]);
      }
      this.formList.find(x => x.fieldName === '7201').itemList = arr.map(x => ({ value: x.repairTtypeCode, text: x.repairTypeNme }));
    },
    // 获取质检员下拉列表
    async queryQuailtyInspector() {
      let consultant = { role: dictCode.EXAMINATION_CLERK };
      const consultantRes = await searchRoleByCode(consultant);
      if (consultantRes.resultCode == 200) {
        this.formList.find(item => item.fieldName == '1012').itemList = consultantRes.data.map(x => ({ text: x.employeeName, value: x.userId + '' }));
      }
    }
  }
};
</script>

<style lang="less" scoped>
p {
  background-color: #d3dce6;
  height: 20px;
  line-height: 20px;
  margin-bottom: 10px;
}
.maintain {
  position: relative;
  top: -6px;
}
.flexRow {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-left: 80px;
}
</style>
